'use strict'
const Sequelize=require('sequelize');
var config={
    dialect:'mssql',
    database:'postData',
    username:'sa',
    password:'123456',
    host:'localhost'
};

var sequelize=new Sequelize('postData',config.username,config.password,{
    host:config.host,
    dialect:config.dialect
});

// 测试链接数据库
console.log('测试链接:');
sequelize.authenticate().then(()=>{
    console.log(`链接数据库${config.database}成功`);
}).catch((err)=>{
    console.log(`链接失败：${err}`)
});

module.exports=sequelize;

